<?php 
/**
 * eBay Label Printing Program Article Section Database Table Class 
 * this is a Db Table Class , It stores article section Definations, section is the top level structure of the cms part
 * @package  eBayLabelPrinter
 * @category Models/DbTable
 * @author   Norman Dong <norman.dong@hotmail.com>
 * @version  Initial
 * @copyright LeadCasket.com
 * @link     www.leadcasket.com
 * @license  Commercial
 */
 class Model_DbTable_Cms_Articlesection extends Zend_Db_Table_Abstract 
{
	/**
	 * @var string Class Table Name
	 */
	protected $_name = 'article_section'; 
	/**
	 * Get Seller Group By ID 
	 * Not decide what to do Yet
	 * @param int $idSeller  The Seller ID
	 * @return array  Not decide what to return 
	 */	
	public function getArticleSection($sectionID){
		
		$row = $this->fetchRow('`id_section_article`='.(int)$sectionID);
		if(!$row){
			return false;
		}
		return $row->toArray();		
	}
	public function AddArticleSection($sectionTitle,$sectionPosition,$available){
		$data = array(
				'title_section_article' =>$sectionTitle,
				'position_section_article' => $sectionPosition,
				'available_section_article'=>$available,
				);
		$this->insert($data);
	}
	public function updateArticleSection($sectionID,$sectionTitle,$sectionPosition,$available){
		$data = array(
				'title_section_article' =>$sectionTitle,
				'position_section_article' => $sectionPosition,
				'available_section_article'=>$available,
		);
		$this->update($data,'id_section_article ='.$sectionID);
	}
	public function deleteArticleSection($sectionID){
		$this->delete('id_section_article =' . $sectionID);		
	}
	public function listSection(){
		$order = new Zend_Db_Expr('`position_section_article`');
		$rows = $this->fetchAll('1',$order);
		if(empty($rows)){
			return false;
		}
		return $rows->toArray();		
	}
				
}
?>